<%@ page pageEncoding="utf-8"%>

<!-- 样式 -->
<link href="${ctx}/css/admin.css" rel="stylesheet" type="text/css" />
<link type="text/css" rel="stylesheet" href="${ctx }/js/formValidator3.5/style/validator.css"></link>

<!-- jquery -->
<script src="${ctx}/js/jquery.js" type="text/javascript"></script>

<script src="${ctx}/js/jquery.form.js" type="text/javascript"></script>
<script src="${ctx}/js/thickbox.js" type="text/javascript"></script>

<!-- jquery 验证控件 -->

<script src="${ctx }/js/formValidator3.5/formValidator.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx }/js/formValidator3.5/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>

<!-- 取得当前窗口的尺寸 -->
<script src="${ctx}/js/Geometry.js" type="text/javascript"></script>

<!-- 日期控件 -->
<script src="${ctx }/js/DatePicker/WdatePicker.js" type="text/javascript" defer="defer"></script>

<!-- ajaxanywhere -->
<script src="${ctx}/js/aa.js" type="text/javascript"></script>

<script type="text/javascript">

function resizeIframeReport(){
	document.getElementById("displayReport").height = Geometry.getViewportHeight()-28-48;
}

function chg(id_num){
         var oa = document.getElementById(id_num);
         var ob = document.getElementById("ImgArrow");
		 var imgButton = document.getElementById("imgButton");
         if(oa.style.display == "block"){
                 oa.style.display = "none";
                 imgButton.src = "${ctx }/images/icon_down.gif";
				 imgButton.alt = "显示搜索";
         }else{
                 oa.style.display = "block";
                 imgButton.src = "${ctx }/images/icon_up.gif";
				 imgButton.alt = "隐藏搜索";
         }
         return false;
}


//查询URL
var doListUrl = "";

var doAddBeforeUrl = "";
var doSaveUrl = "";

var doUpdateBeforeUrl = "";
var doUpdateUrl = "";

var doDelUrl = "";
var doViewUrl = "";
var doReturnUrl = "";  //返回

//查询
function doQuery(){
   var _form = document.forms[0];
   if(doListUrl == ''){
   	alert('请设置正确的URL!');
   	return false;
   }

   _form.action = doListUrl;
   _form.submit();
   if(typeof(ajaxAnywhere) != "underfined"){
		ajaxAnywhere.showLoadingMessage();
	}
}

//支持Ajax查询
function doAjaxQuery(){
   var _form = document.forms[0];
   if(doListUrl == ''){
   	alert('请设置正确的URL!');
   	return false;
   }

   _form.action = doListUrl;
   ajaxAnywhere.submitAJAX();
}

//查看
function doView(){
   var _form = document.forms[0];
   if(doViewUrl == ''){
   	alert('请设置正确的URL!');
   	return false;
   }

   _form.action = doViewUrl;
   _form.submit();
}

//返回
function doReturn(){
   var _form = document.forms[0];
   if(doReturnUrl == ''){
   	alert('请设置正确的URL!');
   	return false;
   }

   _form.action = doReturnUrl;
   _form.submit();
}

//清空查询条件
function doReset(){
   var inputList = document.getElementsByTagName("input");
   for(var i=0;i<inputList.length;i++){
   		var obj = inputList[i];
   		if(obj.type == 'text'){
   			obj.value = "";
   		}
   }
   
   var selList = document.getElementsByTagName("select");
   for(var i=0;i<selList.length;i++){
   		var obj = selList[i];
   		obj.value = "";
   }
}

function getFocus(obj,infoObj,infoObjInfo){
	obj.focus();
	if(infoObj != null && infoObj != "undefined"){
		infoObj.innerHTML = infoObjInfo;
	}
}

function cleanData(obj,infoObj,infoObjInfo){
	obj.value = "";
	if(infoObj != null && infoObj != "undefined"){
		infoObj.innerHTML = infoObjInfo;
	}
}

function disInfo(infoObj,infoObjInfo){
	if(infoObj != null && infoObj != "undefined"){
		infoObj.innerHTML = infoObjInfo;
	}
}

function cleanDataAndGetFocus(obj,infoObj,infoObjInfo){
	obj.value = "";
	obj.focus();
	if(infoObj != null && infoObj != "undefined"){
		infoObj.innerHTML = infoObjInfo;
	}
}

//刷新父窗口
function refreshFrame(fremeName){
	var leftFrame = window.parent.frames[fremeName];
	if(leftFrame != null && leftFrame != "undefined"){
		leftFrame.location.reload();
	}
}

//刷新父窗口
function refreshParentFrame(frameName,url){
	var frame = window.parent.frames[frameName];
	if(frame != null && frame != "undefined"){
		frame.src = url;
	}
}

function refreshParentFrame(frameName,url){
	var frame = window.parent.frames[frameName];
	if(frame != null && frame != "undefined"){
		frame.location.href = url;
	}
}

/**
刷新thickbox窗口的父窗口，适用于FrameSet的情况
*/
function refreshThickboxParentWindow(url)
{	
	var win = top.window;
    try{ 
        if(win){ 
        	if(typeof(ajaxAnywhere)){
        		ajaxAnywhere.showLoadingMessage();
        	}
        	if(url != null && url != ''){
        		win.location.href = url;
        	}else{
           		win.location.reload();
           }
        }
    }catch(ex){} 
    parent.tb_remove();
}

/**
刷新thickbox窗口的父窗口，适用于iframe的情况
*/
function refreshThickboxParentFrameWindow(vurl)
{	
	var win = top.window;
 	try{
	 	var mainFrame = win.document.all.mainFrame;
	    if(mainFrame) {
	    	if(vurl != null && vurl != ''){
	    		mainFrame.src = vurl;
	    		if(typeof(ajaxAnywhere)){
        			ajaxAnywhere.showLoadingMessage();
        		}
	    	}else{
		    	var url = mainFrame.src;
		    	mainFrame.src = url;
		    	if(typeof(ajaxAnywhere)){
        			ajaxAnywhere.showLoadingMessage();
        		}
	    	}
	    }
 	}catch(ex){
 	}
 	parent.tb_remove();
}
</script>


